package com.huibo.product.controller;

import com.huibo.goods.util.AjaxResult;
import com.huibo.product.domain.Product;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @GetMapping("/find")
    public AjaxResult find(){
        try {
            Product p = new Product();
            p.setId(1L);
            p.setName("鞋子");
            p.setSubName("潮流鞋子");
            return AjaxResult.getInstance().setMsg("查询成功").setData(p);
        } catch (Exception e){
            e.printStackTrace();
            return AjaxResult.getInstance().setMsg("查询失败").setCode(500);
        }
    }

}
